package allwe.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.handler.SimpleMappingExceptionResolver;

import java.util.Properties;

//@Configuration
public class ExceptionConfig {
    @Bean
    public SimpleMappingExceptionResolver getSimpleMappingExceptionResolver(){
        System.out.println("=======================异常处理");

        SimpleMappingExceptionResolver simpleMappingExceptionResolver = new SimpleMappingExceptionResolver();

        Properties prop = new Properties();
        prop.put("java.lang.ArithmeticException","error1.jsp");

        simpleMappingExceptionResolver.setExceptionMappings(prop);
        return simpleMappingExceptionResolver;
    }

}
